//
//  KZExt_Operator.swift
//  KZSwiftMoudel
//
//  Created by 朱凯 on 2018/5/9.
//  Copyright © 2018年 JooKey. All rights reserved.
//

import Foundation

import UIKit

// MARK: ------ 操作符重写


//precedencegroup MyPrecedence {
//    associativity: left
//    higherThan: AdditionPrecedence
//    lowerThan: MultiplicationPrecedence
//}


infix operator +-: AdditionPrecedence
extension CGPoint {
    
    static func * (_ left: CGPoint, _ right: CGFloat) -> CGPoint {
        
        return CGPoint.init(x: left.x * right, y: left.y * right)
    }
    
    static func + (_ left: CGPoint, _ right: CGPoint) -> CGPoint {
        
        return CGPoint.init(x: left.x + right.x, y: left.y + right.y)
    }
    
    static func +- (_ left: CGPoint, _ right: CGPoint) -> CGPoint {
        return CGPoint(x: left.x + right.x, y: left.y - right.y)
    }
}
